<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupSetLanguage</title>

<link rel="stylesheet" type="text/css" href="../../style.css">
</head>
<body>

<h2>IupSetLanguageString</h2>
<p>Associates a name with a string as an auxiliary method for 
Internationalization of applications.</p>
<h3>
Parameters/Return</h3>
<pre>void IupSetLanguageString(const char *<b>name</b>, const char *<strong>value</strong>); [in C] 
void IupStoreLanguageString(const char *<b>name</b>, const char *<strong>value</strong>);<br>
iup.SetLanguageString(<b>name, value</b>: string) [in Lua]</pre>
<p><b>name</b>: name of the string.<br><strong>value</strong>: string value. </p>
<h3>Notes</h3>
<p><strong>IupStoreLanguageString</strong> will duplicate the string internally.
<strong>IupSetLanguageString</strong> will store the pointer.</p>
<p>Elements that have pre-defined texts use this function when the current 
language is changed using <strong>IupSetLanguage</strong>.
  </p>
<p>IUP will <strong>not</strong> store strings for several languages at the same 
time, it will store only for the current language. When <strong>IupSetLanguage</strong> 
is called only the internal pre-defined strings are replace in the internal 
database. The application must register again all its strings for the new 
language.
  </p>
<p>If a dialog is created with string names associations and the associations 
are about to be changed, then the dialog must be destroyed <strong>before</strong> 
the associations are changed, then created again.</p>
<p>Associations are retrieved using the <strong>IupGetLanguageString</strong> 
function. But to simplify the usage of the string names associations attributes 
set with regular <strong>IupSetStr</strong>* functions can use the prefix &quot;_@&quot; 
to indicate a string name and not the actual string. This includes any 
attributes set in LED or in Lua. <strong>IupSetAttribute</strong>* functions can 
not be used because they simply store a pointer that may not be a string.</p>
<h3>Examples</h3>
<pre>
// If Language is Englih 
<strong>IupSetLangueString</strong>("IUP_CANCEL", "Cancel");
  or
// If Language is Portuguese
<strong>IupSetLangueString</strong>("IUP_CANCEL", "Cancelar");


// Then when setting a button title use:
Ihandle* button_cancel = <strong>IupButton</strong>(<strong>IupGetLanguageString</strong>("IUP_CANCEL"), NULL);
  or
Ihandle* button_cancel = <strong>IupButton</strong>("_@IUP_CANCEL", NULL);
  or
<strong>IupSetStrAttribute</strong>(button_cancel, &quot;TITLE&quot;, "_@IUP_CANCEL&quot;);
</pre>
<h3>See Also</h3>
<p><a href="iupgetlanguagestring.html">IupGetLanguageString</a>,
  <a href="iupsetlanguagepack.html">IupSetLanguagePack</a></p>

</body>

</html>